Virtualization is a hot technology in an existing data center. Virtualization technologies for a central processing unit (CPU) and a memory are rapidly developing. However, input/output (IO) virtualization relatively lags behind, which becomes a performance bottleneck of rapid development of the virtualization technologies. Many hardware manufacturers put forward and use different solutions for the IO virtualization technology.
Now, some new virtualization technologies are constantly applied to a physical network interface card of a communications device. For example, a single-root IO virtualization (SR-IOV) technology and a virtual machine device queue (VMDQ) use a pass-through technology, that is, a physical network interface card is directly mapped to a virtual machine, and the virtual machine loads a driver of the physical network interface card. However, a physical network interface card used by a virtual machine in this manner loses its sharing capability, and becomes an exclusive device of the virtual machine. If a quantity of virtual machines is less than a quantity of physical network interface cards, network performance of the communications device can be maximized. If the quantity of virtual machines is greater than the quantity of physical network interface cards, a virtual machine that cannot correspond to a physical network interface card needs to share the physical network interface card using the conventional Open vSwitch (OVS) or in a bridging manner, and physical network interface cards corresponding to these virtual machines are configured in a process of creating the virtual machines.
Because in practical application, a requirement of a virtual machine for a network resource is dynamically changed, when a manner of configuration at the beginning of creating the virtual machine is used, it is possible to cause a situation in which network resources of some virtual machines are insufficient and network resources of some virtual machines are surplus, resulting in improper resource allocation.